package com.wx.service.impl;

import com.wx.constants.Constants;
import com.wx.domain.dto.DayReportQueryParam;
import com.wx.domain.vo.FollowStatistics;
import com.wx.entity.SysNotepad;
import com.wx.mapper.SysNotepadMapper;
import com.wx.service.SysNotepadService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class SysNotepadServiceImpl extends BaseServiceImpl<SysNotepad> implements SysNotepadService {

    @Resource
    private SysNotepadMapper sysNotepadMapper;

    @Override
    public List<SysNotepad> listPage(SysNotepad sysNotepad) {
        return sysNotepadMapper.listPage(sysNotepad);
    }

    @Override
    public int deleteById(String id, String openid, String nickname) {
        SysNotepad update = new SysNotepad();
        update.setId(id);
        update.setDelFlag(Constants.DELETE_YES);
        update.setUpdateDate(new Date());
        update.setUpdateBy(openid);
        update.setUpdater(nickname);
        return sysNotepadMapper.updateByPrimaryKeySelective(update);
    }

    @Override
    public List<FollowStatistics> queryTemporaryInquiryCount(DayReportQueryParam dayReportQueryParam) {
        return sysNotepadMapper.queryTemporaryInquiryCount(dayReportQueryParam);
    }
}
